// @ts-ignore

 
import { api } from '@/utils/api';

/** 计算周成本数据 POST /proDataCostWeek/calculate */
export async function proDataCostWeekCalculate(
  body: BIZAPI.ProDataCostWeekListReq,
  options?: ArgumentsType<typeof api>[1]
): Promise<BIZAPI.IResultVoid>;

export async function proDataCostWeekCalculate(
  body: BIZAPI.ProDataCostWeekListReq,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BIZAPI.IResultVoid>>;

export async function proDataCostWeekCalculate(
  body: BIZAPI.ProDataCostWeekListReq,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BIZAPI.IResultVoid>;

export async function proDataCostWeekCalculate(
  body: BIZAPI.ProDataCostWeekListReq,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BIZAPI.IResultVoid>(`/app/proDataCostWeek/calculate`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BIZAPI.IResultVoid>(`/app/proDataCostWeek/calculate`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 每个类别每周生成一条数据 POST /proDataCostWeek/generate */
export async function proDataCostWeekGenerate(
  options?: ArgumentsType<typeof api>[1]
): Promise<BIZAPI.IResultVoid>;

export async function proDataCostWeekGenerate(
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BIZAPI.IResultVoid>>;

export async function proDataCostWeekGenerate(
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BIZAPI.IResultVoid>;

export async function proDataCostWeekGenerate(options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BIZAPI.IResultVoid>(`/app/proDataCostWeek/generate`, {
      method: 'POST',
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BIZAPI.IResultVoid>(`/app/proDataCostWeek/generate`, {
    method: 'POST',
    ...(options || {})
  });
}

/** 获取周成本情况列表数据 POST /proDataCostWeek/list */
export async function proDataCostWeekList(
  body: BIZAPI.ProDataCostWeekListReq,
  options?: ArgumentsType<typeof api>[1]
): Promise<BIZAPI.IResultListProDataCostWeekEntity>;

export async function proDataCostWeekList(
  body: BIZAPI.ProDataCostWeekListReq,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BIZAPI.IResultListProDataCostWeekEntity>>;

export async function proDataCostWeekList(
  body: BIZAPI.ProDataCostWeekListReq,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BIZAPI.IResultListProDataCostWeekEntity>;

export async function proDataCostWeekList(
  body: BIZAPI.ProDataCostWeekListReq,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BIZAPI.IResultListProDataCostWeekEntity>(`/app/proDataCostWeek/list`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BIZAPI.IResultListProDataCostWeekEntity>(`/app/proDataCostWeek/list`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 保存周成本情况 POST /proDataCostWeek/save */
export async function proDataCostWeekSave(
  body: BIZAPI.ProDataCostWeekEntity[],
  options?: ArgumentsType<typeof api>[1]
): Promise<BIZAPI.IResultVoid>;

export async function proDataCostWeekSave(
  body: BIZAPI.ProDataCostWeekEntity[],
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BIZAPI.IResultVoid>>;

export async function proDataCostWeekSave(
  body: BIZAPI.ProDataCostWeekEntity[],
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BIZAPI.IResultVoid>;

export async function proDataCostWeekSave(
  body: BIZAPI.ProDataCostWeekEntity[],
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BIZAPI.IResultVoid>(`/app/proDataCostWeek/save`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BIZAPI.IResultVoid>(`/app/proDataCostWeek/save`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}
